import Vue from 'vue'
import Router from 'vue-router'
import index from '../components/index/index.vue'

Vue.use(Router);

const menu = resolve => require(['../components/menu.vue'], resolve);
const editPage = resolve => require(['../components/editPage/editPage.vue'], resolve);
const inbox = resolve => require(['../components/inbox/inbox.vue'], resolve);
const detail = resolve => require(['../components/detailPage.vue'], resolve);
const contacts = resolve => require(['../components/contacts/contacts.vue'], resolve);
const search = resolve => require(['../components/search.vue'], resolve);

export default new Router({
  routes: [
    {
      path: '/',
      name:"index",
      component: index,
      children:[
        {path: '/indexDetail/:id', name:"indexDetail", component: detail}
      ]
    },
    {path: '/menu', name:"menu", component: menu},
    {path: '/editPage', name:"editPage", component: editPage},
    {path: '/search', name:"search", component: search},
    {path: '/contacts', name:"contacts", component: contacts},
    {
      path: '/inbox/:flag',
      name:"inbox",
      component: inbox,
      children:[
        {path: '/inboxDetail/:id', name:"inboxDetail", component: detail}
      ]
    },
  ]
})
